Support ports as integers#315
Conversation
1de3090 to
edc7acd
Compare
|
Thanks for the contribution @alexharv074. Indeed having to specify ports as strings may be a bit misleading and unexpected. I do appreciate that you have implemented a backward compatible approach. The PR looks good to me, the tests are currently failing not totally sure why at a quick glance. I'll take a better look in a bit. |
truthbk
left a comment
There was a problem hiding this comment.
Found a couple of things. I tried these changes locally and the tests passed with PUPPET_VERSION=4.2.1 (didn't try the full matrix however).
There was a problem hiding this comment.
This will probably have to look like this to pass the linter:
# lint:ignore:only_variable_string
$_statsd_forward_port = "${statsd_forward_port}"
$_proxy_port = "${proxy_port}"
$_graphite_listen_port = "${graphite_listen_port}"
$_listen_port = "${listen_port}"
$_pup_port = "${pup_port}"
$_syslog_port = "${syslog_port}"
# lint:endignore
There was a problem hiding this comment.
Typo here (two underscores). This should be:
validate_re($_graphite_listen_port, '^\d*$')
ddee3ed to
b85e9ae
Compare
|
Great, I updated the PR with your changes. |
Without this patch applied, compilation fails if integer data for ports (proxy_port, pup_port etc) is passed in. This is a problem, because it requires us to quote ports in Hiera, and is a surprising and unexpected behaviour. After this patch is applied, it is possible to specify these ports either as a string or an integer. Tests are added for each port showing that integer or string inputs both lead to the same configuration in the catalog.
b85e9ae to
554796b
Compare
|
I also fixed up some whitespace issues (spaces at end of line, unwanted spaces between blocks etc). |
Without this patch applied, compilation fails if integer data for ports (proxy_port, pup_port etc) is passed in. This is a problem, because it requires us to quote ports in Hiera, and is a surprising and unexpected behaviour. After this patch is applied, it is possible to specify these ports either as a string or an integer. Tests are added for each port showing that integer or string inputs both lead to the same configuration in the catalog.
Without this patch applied, compilation fails if integer data for ports
(proxy_port, pup_port etc) is passed in.
This is a problem, because it requires us to quote ports in Hiera, and
is a surprising and unexpected behaviour.
After this patch is applied, it is possible to specify these ports
either as a string or an integer.
Tests are added for each port showing that integer or string inputs both
lead to the same configuration in the catalog.